using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Yozeev.SystemConfig
{
    /// <summary>
    /// 菜单
    /// </summary>
    public class Menu : ByUserEntity<Guid>
    {
        /// <summary>
        /// 上级菜单
        /// </summary>
        public Guid? ParentId { get; set; }
        [ForeignKey("ParentId")]
        public virtual Menu Parent { get; set; }
        /// <summary>
        /// 菜单名称
        /// </summary>
        [Required]
        [StringLength(128)]
        public string MenuName { get; set; }
        /// <summary>
        /// 菜单代码
        /// </summary>
        [Required]
        [StringLength(128)]
        public string MenuCode { get; set; }
        /// <summary>
        /// 链接
        /// </summary>
        [Required]
        [StringLength(128)]
        public string NavigateUrl { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public long? Sort { get; set; }
        /// <summary>
        /// 层级
        /// </summary>
        public long? Level { get; set; }
        /// <summary>
        /// 图标
        /// </summary>
        [Required]
        [StringLength(128)]
        public string IocName { get; set; }
        /// <summary>
        /// 图标地址
        /// </summary>
        [Required]
        [StringLength(128)]
        public string IocClassName { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
        public virtual ICollection<Power> Powers { get; set; }
    }
}
